home *** CD-ROM | disk | FTP | other *** search
- on openP
- global DBfact, TBfact
- set DBfact to xtra("V12Dbe")
- set TBfact to xtra("V12Table")
- end
-
- on createDB
- global DBfact
- set gDb to new(DBfact, the pathName & "shareW.db", "cr", "imagine")
- mCreateTable(gDb, "shareware")
- put mCreateField(gDb, "shareware", "category", "String", 255)
- put mCreateField(gDb, "shareware", "name", "String", 255)
- put mCreateField(gDb, "shareware", "description", "String", 3400)
- put mCreateField(gDb, "shareware", "filepath", "String", 255)
- put mCreateField(gDb, "shareware", "url", "String", 255)
- put mCreateField(gDb, "shareware", "contact", "String", 2000)
- put mCreateIndex(gDb, "shareware", "catIdx", "d", "category", "a")
- put mCreateIndex(gDb, "shareware", "nameIdx", "d", "name", "a")
- put mBuild(gDb)
- set gDb to 0
- end
-
- on openDB
- global DBfact, TBfact, gDb, gTB
- set gDb to new(DBfact, the pathName & "shareW.db", "ReadWrite", "imagine")
- set gTB to new(TBfact, mGetRef(gDb), "shareware")
- end
-
- on Import
- global DBfact, TBfact, gDb, gTB
- put mImportFile(gTB, the pathName & "shareW.txt", TAB, RETURN)
- end
-
- on setOne
- global gTB
- put mAddRecord(gTB)
- put mSetField(gTB, "AppName", "BoneHead")
- put mSetField(gTB, "url", "www.wiredplanet.com")
- put mUpdateRecord(gTB)
- end
-
- on getOne
- global gTB
- put mGetField(gTB, "name", 1, 2)
- end
-
- on listIt
- global gTB
- put EMPTY into field "theList"
- set n to mSelectCount(gTB)
- repeat with i = 1 to n
- put mGetField(gTB, "category", "category") after field "theList"
- mGoNext(gTB)
- end repeat
- end
-
- on closeP
- global gTB, gDb
- set gTB to 0
- set gDb to 0
- end
-
- on CreateIt
- openP()
- createDB()
- openDB()
- Import()
- closeP()
- end
-
- on showSelection
- global gTB
- cursor(4)
- set n to mSelectCount(gTB)
- put n into field "totalCount"
- set temp to mGetPosition(gTB)
- mGoFirst(gTB)
- put EMPTY into field "zlist"
- set dummy to EMPTY
- repeat with i = 1 to n
- set nm to mGetField(gTB, "name")
- put nm & RETURN after dummy
- mGoNext(gTB)
- end repeat
- put dummy into field "zlist"
- mGo(gTB, temp)
- updateDisplay()
- cursor(-1)
- end
-
- on updateDisplay
- global gTB
- set i to mGetPosition(gTB)
- set the foreColor of field "zlist" to 255
- set the foreColor of line i of field "zlist" to 1
- put mGetField(gTB, "name") into field "Name"
- put mGetField(gTB, "description") into field "zdesc"
- put mGetField(gTB, "contact") into field "zspecial"
- put mGetField(gTB, "url") into field "zurl"
- put mGetField(gTB, "filepath") into field "Path"
- end
-
- on domSelectCount
- global gTB
- put mSelectCount(gTB) into field "totalCount"
- end
-
- on CheckError errCode, msg
- global gDb
- if errCode <> 0 then
- if objectp(gDb) then
- set errTxt to mError(gDb, errCode)
- else
- set errText to "unknown error"
- end if
- alert("Error" && errCode && "(" & errTxt & ") occured at" && msg)
- end if
- end
-
- on TrackClick
- set spriteNum to the clickOn
- set offCast to the castNum of sprite spriteNum
- set onCast to offCast + 1
- set the castNum of sprite spriteNum to onCast
- updateStage()
- repeat while the mouseDown
- if rollOver(spriteNum) then
- set the castNum of sprite spriteNum to onCast
- else
- set the castNum of sprite spriteNum to offCast
- end if
- updateStage()
- end repeat
- set the castNum of sprite spriteNum to offCast
- updateStage()
- return rollOver(spriteNum)
- end
-
- on getdrive
- set curpath to the moviePath
- set olddelimiter to the itemDelimiter
- set the itemDelimiter to "\"
- set drive to item 1 of curpath & "\"
- set the itemDelimiter to olddelimiter
- return drive
- end
-
- on restartMe
- global DBfact, TBfact
- clearGlobals()
- openXLib(the pathName & "xtras:V12Dbe")
- openXLib(the pathName & "xtras:V12Table")
- set DBfact to xtra("V12Dbe")
- set TBfact to xtra("V12Table")
- set the visible of sprite 47 to 0
- put "All Shareware" into field "fld"
- end
-